<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script>
        var a = 123;
        console.log(typeof a);
    </script> -->
    <!-- <script>
        var num = 12;
        console.log(typeof num);    //number
        var str = ' a string';
        console.log(typeof str);    //  string
        var flag = true;
        console.log(true);          //true
        var un  = undefined;
        console.log(undefined);     //undefined
        var time = null;
        console.log(typeof time);     //object
        var pr = prompt('请输入字符内容');
        alert( typeof pr);
    </script> -->
    <!-- <script>
        console.log(20);
        console.log('22');
        console.log(true);
        console.log(undefined);
        console.log(null);
    </script> -->
    <!-- <script>
        var a = prompt('第一个值');
        var b = prompt('第二个值');
        alert(a+b);   
    </script> -->
    <!-- <script>
        var a = 123;
        console.log(a.toString());
        var b = 456;
        console.log(String(b));
        var c = 789;
        console.log('我是一个字符串'+c);
    </script> -->
    <!-- <script>
        //parselnt(string)函数,将string类型转成整数数值型
        var a = '字符串';
        console.log(parseInt(a));   //NaN
        var b = '123123';
        console.log(parseInt(b));   //123123,数值类型
        var c = '3.1415926';
        console.log(parseInt(c));   //3,因为parseInt是取整
        consolo.log(parseInt('120px'));  //120,会去掉单位
        consolo.log(parseInt('re120px'));   //NaN
    </script> -->
    <!-- <script>
        // parseFloat(string)函数,将string类型转成浮点数数值型
        var a = '3.141592612314231';         //3.1415926123142312
        console.log(parseFloat(a));
        var b = '0.1111111';           
        console.log(parseFloat(b));   //0.1111111 
        var c = '12.23';                                  
        console.log(parseFloat(c));
    </script> -->
    <!-- <script>
        // Number()强制转换函数,将string类型转换为数值型
        var a = '123';
        console.log(Number(a)); //123
    </script> -->
    <!-- <script>
        // 字符串通过算术运算符进行隐式转换
        var a = '12'-0;
        var b = '10' * 2;
        var c = '10' /5;
        var d = '100' - '80';  
        console.log(a); //12
        console.log(b); //20
        console.log(c); //2
        console.log(d); //20
    </script> -->
    <!-- <script>
        //弹出一个输入框，让用户输入出生年份
        var age = prompt('你出生的年份');
        //用现在的年份减去用户输入的年份，就是现在的年龄
        var year = 2021 - age;
        //弹出警示框，把计算的结果输出
        alert(year);
    </script> -->
    <!-- <script>
        var a = prompt('输入的第一个值');
        var b = prompt('输入的第二个值');  
        //因为字符串算术运算符中没有设置加号，所以无法通过隐式转换。所以需要进行函数进行转换。
        var c = parseFloat(a)+parseFloat(b);
        console.log(c);     //2
    </script> -->
    <!-- <script>
        var a = 0.1+0.2;
        console.log(a);     //结果不是0.3,而是0.30000000000000004
        console.log(0.07*100);  //结果不是7，而是7.000000000000001
    </script>
    <script>
        var num = 10;
        alert (++num + 10); // 21
    </script>
    <script>
        var num = 10;
        alert(10 + num++); // 20
    </script> -->
    <!-- <script>
        console.log(18 == '18');		//true
        console.log(18 === '18');		//false
    </script> -->
    <script>
        var isOk = !true;
        console.log(isOk);  // false
        //逻辑非（!）也叫作取反符，用来取一个布尔值相反的值，如 true 的相反值是 false
    </script>
</head>
<body>
    
</body>
</html>